<?php
/*! \brief
 * This is WFLangFactory class
 * This is a factory class that gets relative lang object
 * \author William Su
 */
class WFLangFactory
{
    /**
     * @var instance
     */
    private static $instance;
    /**
     * @var WF
     */
    private $objFramework;
    public function __construct($objFramework){
        $this->objFramework = $objFramework;
    }
    /**
     * @return WFL10N
     */
    public function getL10N(){
        if(! isset(self::$instance[__FUNCTION__])){
            require_once dirname(__FILE__) . '/L10N.php';
            self::$instance[__FUNCTION__] = new WFL10N($this->objFramework);
        }
        return self::$instance[__FUNCTION__];
    }
    /**
     * @return WFProductL10N
     */
    public function getProductL10N($strProductFolder){
        if(! isset(self::$instance[__FUNCTION__][$strProductFolder])){
            require_once dirname(__FILE__) . '/ProductL10N.php';
            self::$instance[__FUNCTION__][$strProductFolder] = new WFProductL10N($this->objFramework,$strProductFolder);
        }
        return self::$instance[__FUNCTION__][$strProductFolder];
    }
    /**
     * @return WFWFL10N
     */
    public function getWFL10N(){
        if(! isset(self::$instance[__FUNCTION__])){
            require_once dirname(__FILE__) . '/WFL10N.php';
            self::$instance[__FUNCTION__] = new WFWFL10N($this->objFramework);
        }
        return self::$instance[__FUNCTION__];
    }
}
